package nl.altenpts.net.broker;

import java.net.InetSocketAddress;
import java.nio.ByteBuffer;
/**
 * 
 * An incoming message. The payload of the message is stored in a single
 * ByteBuffer. 
 * 
 * @author fabian
 *
 */

public class IncomingMessage {
	

	/**
	 * Constructs a new IncomingMessage.
	 * 
	 * @param payload The payload of the message
	 * @param host Origin host
	 * @param port Origin port
	 */
	public IncomingMessage(ByteBuffer payload, InetSocketAddress address) {
		this.payload = payload;
		this.address = address;
	}
	
	
	public InetSocketAddress getAddress() {
		return address;
	}
	
	/**
	 * Returns the payload of the message
	 * 
	 * @return the payload of the message
	 */
	public ByteBuffer getPayload() {
		return payload;		
	}
	

	private ByteBuffer payload;
	private InetSocketAddress address;
}

